package kr.pe.johnkim.app.mobile.rest.service;

import kr.pe.johnkim.app.domain.MyHistoryGroup;
import kr.pe.johnkim.app.mobile.rest.dao.MyHistoryGroupDao;
import kr.pe.johnkim.app.mobile.rest.dao.MyHistoryGroupDaoImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.List;

/**
 * My History Group 기능 들을 구현 하는 클래스 이다.
 * 
 * @author : johnkim <cale9797@gmail.com / Bettersoft Inc,.>
 * @Date : 12. 2. 5
 */
public class MyHistoryGroupServiceImpl implements MyHistoryGroupService {
    // SLF4J Logging
	private Logger logger = LoggerFactory.getLogger(MyHistoryGroupServiceImpl.class);

    /**
     * My History 그룹 중복 등록을 확인 한다.
     *
     * @param myHistoryGroup
     * @return
     */
    @Override
    public MyHistoryGroup checkDuplication(MyHistoryGroup myHistoryGroup) {
        logger.info("checkDuplication");
        return myHistoryGroupDao.checkDuplication(myHistoryGroup);
    }

    /**
     * 그룹을 등록 한다.
     *
     * @param myHistoryGroup
     * @return
     */
    @Override
    public boolean registerGroup(MyHistoryGroup myHistoryGroup) {
        logger.info("registerGroup");
        return myHistoryGroupDao.registerGroup(myHistoryGroup);
    }

    /**
     * 그룹 내용을 가져 온다.
     *
     * @param myHistoryGroup
     * @return
     */
    @Override
    public MyHistoryGroup selectGroup(MyHistoryGroup myHistoryGroup) {
        return null;  //To change body of implemented methods use File | Settings | File Templates.
    }

    /**
     * 그룹 목록을 가져 온다.
     *
     * @param myHistoryGroup
     * @return
     */
    @Override
    public List<MyHistoryGroup> selectGroupList(MyHistoryGroup myHistoryGroup) {
        logger.info("selectGroupList");
        return myHistoryGroupDao.selectGroupList(myHistoryGroup);
    }

    /**
     * 그룹 내용을 수정 한다.
     *
     * @param myHistoryGroup
     * @return
     */
    @Override
    public boolean updateGroup(MyHistoryGroup myHistoryGroup) {
        logger.info("updateGroup");
        return myHistoryGroupDao.updateGroup(myHistoryGroup);
    }

    /**
     * 그룹을 비활성화 한다.
     *
     * @param myHistoryGroup
     * @return
     */
    @Override
    public boolean updateDeactivateGroup(MyHistoryGroup myHistoryGroup) {
        logger.info("updateDeactivateGroup");
        return myHistoryGroupDao.updateDeactivateGroup(myHistoryGroup);
    }

    /**
     * 사용자가 등록한 그룹 갯수를 가져 온다.
     *
     * @param myHistoryGroup
     * @return
     */
    @Override
    public MyHistoryGroup selectGroupCount(MyHistoryGroup myHistoryGroup) {
        return null;  //To change body of implemented methods use File | Settings | File Templates.
    }

    /**
     * Group 목록을 등록 한다.
     *
     * @param myHistoryGroup
     * @return
     */
    @Override
    public void registerGroupList(MyHistoryGroup myHistoryGroup) {
        //To change body of implemented methods use File | Settings | File Templates.
    }

    /**
     * Spring Setter Injection.
     */
    private MyHistoryGroupDao myHistoryGroupDao;

    public void setMyHistoryGroupDao(MyHistoryGroupDaoImpl myHistoryGroupDao) {
        this.myHistoryGroupDao = myHistoryGroupDao;
    }
}
